import datetime  # noqa: D100
from dataclasses import dataclass
from typing import Optional


@dataclass
class TransmissionLog:
    """记录数据传输日志，支持增量传输."""

    id: str
    gitlab_instance: str
    repository_id: int
    start_time: datetime.datetime
    status: str
    transferred_count: int = 0
    end_time: Optional[datetime.datetime] = None
    last_synced_at: Optional[datetime.datetime] = None
    last_synced_sha: Optional[str] = None
    error_message: Optional[str] = None
    updated_at: Optional[datetime.datetime] = None
